<template>
  <ElConfigProvider :locale="locale">
    <router-view />
  </ElConfigProvider>
</template>

<script lang="ts">
  import {
    defineComponent,
    ref
  } from 'vue'
  import { ElConfigProvider } from 'element-plus'
  import zhCn from 'element-plus/lib/locale/lang/zh-cn'

  export default defineComponent({
    name: 'App',
    components: {
      ElConfigProvider
    },
    setup() {
      const showPage = ref<boolean>(true)
      // window.addEventListener('beforeunload', () => {
      //   sessionStorage.setItem('jg-info', JSON.stringify(store.state))
      // })
      // if (sessionStorage.getItem('jg-info')) {
      //   store.replaceState(Object.assign({}, store.state, JSON.parse(sessionStorage.getItem('jg-info') || '')))
      //   console.log(store.state.routesList.routesList, 'routesList');
      // }
      return {
        locale: zhCn,
        showPage
      }
    }
  })
</script>
